package javacafe.action.factory;

import javacafe.action.Action;
import javacafe.action.ActionFactory;
import javacafe.action.study.AuthMgrAction;
import javacafe.action.study.AuthMgrFormAction;
import javacafe.action.study.BeforeUpdateBackgroundAction;
import javacafe.action.study.CreateStudyAction;
import javacafe.action.study.CreateStudyFormAction;
import javacafe.action.study.JoinStudyFormAction;
import javacafe.action.study.JoinStudyMemberAction;
import javacafe.action.study.MyStudyListAction;
import javacafe.action.study.StudyListAction;
import javacafe.action.study.StudyMainAction;
import javacafe.action.study.StudySubmenuAction;
import javacafe.action.study.UpdateBackgroudAction;
import javacafe.action.study.WithdrawalStudyMemberAction;

public class StudyActionFactory implements ActionFactory{
	
	private static StudyActionFactory factory;

	public static ActionFactory getInstance() {
		if (factory == null) {
			factory = new StudyActionFactory();
		}
		return factory;
	}
	
	@Override
	public Action getAction(String command) {
		Action action = null;
		if (command.equalsIgnoreCase("createStudyForm")) {
			action = new CreateStudyFormAction();
		}else if (command.equalsIgnoreCase("createStudy")) {
			action = new CreateStudyAction();
		}else if (command.equalsIgnoreCase("studyList")) {
			action = new StudyListAction();
		}else if (command.equalsIgnoreCase("myStudyList")) {
			action = new MyStudyListAction();
		}else if (command.equalsIgnoreCase("studySubmenu")) {
			action = new StudySubmenuAction();
		}else if (command.equalsIgnoreCase("studyMain")) {
			action = new StudyMainAction();
		}else if (command.equalsIgnoreCase("updateBackgroundForm")) {
			action = new BeforeUpdateBackgroundAction();
		}else if (command.equalsIgnoreCase("updateBackground")) {
			action = new UpdateBackgroudAction();
		}else if (command.equalsIgnoreCase("joinstudy")) {
			action = new JoinStudyMemberAction();
		}else if (command.equalsIgnoreCase("joinstudyform")) {
			action = new JoinStudyFormAction();
		}else if (command.equalsIgnoreCase("authmgrform")) {
			action = new AuthMgrFormAction();
		}else if (command.equalsIgnoreCase("authmgr")) {
			action = new AuthMgrAction();
		}else if (command.equalsIgnoreCase("withdrawalStudyMember")) {
			action = new WithdrawalStudyMemberAction();
		}
		
		return action;
	}

}
